#include "enemy.h"
#include <shuju.h>

enemy::enemy()
{
    //敌机图片
    e_plane.load(":/pic/res/diji");
    //敌机位置；
    e_x = 0;
    e_y = 0;
    e_free =1000;
    //碰撞体积
    e_Rect.setWidth(e_plane.width());
    e_Rect.setHeight(e_plane.height());
    e_Rect.moveTo(e_x , e_y);
    //sudu
    speed = 2;

}

void enemy::updateposition()
{
    if(e_free == 1)
    {
        e_y = 1000;
        e_x = 0;
    }
    e_y += speed;
    e_Rect.moveTo(e_x, e_y);
    if(e_y >= sence_h + e_Rect.height())
        e_free = 1;
}
